Repository navigation
fix: reload examples page only when the session has expired - #6702
Merged
Merged
Conversation
The session check sends a heartbeat for UI id 0 and reloaded the page on any non-OK response. Flow answers 404 when the session is alive but has no UI with that id, which is the normal state once the first page of a session has been closed: later pages get higher UI ids. Reloading never changes that, so the page reloaded again every five minutes as more examples were loaded. Reload only on 403, which is what Flow returns for an expired session.
Contributor
Preview DeploymentThis PR has been deployed for preview. URL: https://docs-preview-pr-6702.fly.dev No documentation page changes detected. Other changed files
Built from 3b13396 |
Artur-
marked this pull request as ready for review
November 22, 2026 16:43
vaadin-review-bot
left a comment
There was a problem hiding this comment.
✅ Nothing to flag — the changes look good.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On pages with Flow examples, the docs site could reload itself over and over: after scrolling (which loads more examples), the page reloaded, then again five minutes later, and so on. This PR stops those reloads.
What changed
The session check in
session-verification.tssends a heartbeat for UI id0and used to reload the page on any non-OK response. Flow answers a heartbeat with:403when the session has expired (the case the check was written for);404when the session is alive but has no UI with that id.The
404case is normal. UI ids grow within a session, so once the session's first page is closed (its UI is closed on unload), every later page gets a higher id and the heartbeat for UI0returns404. A reload can't fix that, so the page reloaded every time the 5-minute guard ran out and another example loaded.The check now reloads only on
403. Other failures (404, 5xx while the server restarts) no longer reload the page, since a reload wouldn't help there either. The 5-minute guard is unchanged.Test summary
HeartbeatHandler:404for an unknown UI id,403for an expired session. The live site returns403for a heartbeat without a session.Working on behalf of Artur